/*
 * =====================================================================================
 *
 *       Filename:  cmd.h
 *
 *    Description:  AVL tree node content as cmd.
 *
 *        Version:  1.0
 *        Created:  2017/02/13 11:20:13
 *       Revision:  none
 *       Compiler:  gcc
 *
 *         Author:  Brook L. (), Brook_L@163.com
 *   Organization:  
 *
 * =====================================================================================
 */

#ifndef _CMD_H_
#define _CMD_H_

#define MAX_CMD_CHAR        40

// <user: avl tree node content, must be defined by user>
typedef struct cmd {
    char *cmd;
    void (*process)(char *cmd);
} Cmd;

// <user: typedef user defined AVL tree node content struct as universal struct, 
// must be modified by user>
typedef Cmd AvlNodeContent;

// <user: avl tree callback function, must be implemented by user>
int cmdCompare(Cmd *content1, Cmd *content2);
void cmdInsertMatchProcess(Cmd *content);
void cmdTravProcess(Cmd *content);

#endif /* #ifnef _CMD_H_ */
